-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[move-stdlib] Use vector::move_range inside vector, and evaluate performance / calibrate gas #14862
base: main
Are you sure you want to change the base?
Conversation
⏱️ 8h 45m total CI duration on this PR
🚨 1 job on the last run was significantly faster/slower than expected
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## igor/native_vector_move_range #14862 +/- ##
================================================================
Coverage ? 60.1%
================================================================
Files ? 858
Lines ? 211455
Branches ? 0
================================================================
Hits ? 127237
Misses ? 84218
Partials ? 0 ☔ View full report in Codecov by Sentry. |
75ebf46
to
d724063
Compare
0df908c
to
0fab436
Compare
0fab436
to
b1a2e70
Compare
d724063
to
e4540db
Compare
b1a2e70
to
6b493cd
Compare
e4540db
to
ae8e817
Compare
6b493cd
to
6046016
Compare
ae8e817
to
48df5f1
Compare
6046016
to
c5e50b3
Compare
48df5f1
to
1407c00
Compare
c5e50b3
to
36f8618
Compare
1407c00
to
94d1b68
Compare
36f8618
to
9851f51
Compare
94d1b68
to
51f1f1c
Compare
5b9f388
to
fc3c349
Compare
9fcf365
to
53920f9
Compare
58152b4
to
c268f4a
Compare
53920f9
to
58c55c0
Compare
c268f4a
to
0c7a167
Compare
58c55c0
to
e1f971f
Compare
0c7a167
to
4b040df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(needs rebase, looked at what the summary says)
@@ -326,7 +326,7 @@ impl Features { | |||
pub fn is_loader_v2_enabled(&self) -> bool { | |||
self.is_enabled(FeatureFlag::ENABLE_LOADER_V2) | |||
} | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove
8321a01
to
974ad93
Compare
## Description Memcopy (i.e. `ptr::copy_nonoverlapping` inside of `Vec`) is extremely efficient, and using Vec operations that use it directly is significantly faster (orders of magnitude on bigger vectors) than issuing operations in move. Operations on `vector` that can be speed-up: `insert`, `remove`, `append`, `split_off`. To keep amount of native functions short, instead of having native for each of those, providing one more general native function: `vector::move_range`, which is enough to support all 4 of the above, in addition to other uses. Internally, we shortcircuit a few special cases, for faster speed. ## How Has This Been Tested? Full performance evaluation is in the follow-up PR: #14862 ## Type of Change - [x] Performance improvement ## Which Components or Systems Does This Change Impact? - [x] Move/Aptos Virtual Machine
974ad93
to
f6c8829
Compare
Description
Use vector::move_range inside of vector, to optimize
insert
,remove
,append
,trim
.Extend aptos-move/e2e-benchmark/src/main.rs to track gas and gas/s, to allow for quick calibration.
Adding workloads to txn-emitter to be able to use it throughput.
Additionally add a missing
replace
method, which replaces value at particular index.Running on extended set of params:
https://gist.github.com/igor-aptos/e8d4e21edcbc75dddcb9382d4e077665
Summary of the performance tests:
For gas calibration, on the variety of workloads, current implementation has decent variance. After tuning params to match the averages, variance seems much smaller.
How Has This Been Tested?
Key Areas to Review
Type of Change
Which Components or Systems Does This Change Impact?
Checklist